{extend name="index/iframe" /}

{block name="content"}
<div style="padding: 10px;">
    <form class="layui-form layui-form-my" action="">
        <input type="hidden" value="{$Think.get.id}" name="id">
        <div class="layui-form-item">
            <label class="layui-form-label">驳回原因</label>
            <div class="layui-input-block">
                <textarea name="reason" placeholder="请输入驳回原因" class="layui-textarea">{$find.reason}</textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn my-btn" lay-submit="" lay-filter="submitBtn" >立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>

</div>
{/block}

{block name="css"}
{/block}

{block name="js"}
<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var $ = layui.$
            ,form = layui.form
            ,layer = layui.layer;

        //提交
        form.on('submit(submitBtn)', function(data){
            var load = layer.load();
            $.post('{:url("RebateChannel/reason")}',data.field, function(json){
                layer.close(load);
                json.code==0 ? layer.msg(json.msg, {icon: 1, time: 1000}) : layer.msg(json.msg, {icon: 0, time: 1000});
            }, 'JSON').error(function(){
                layer.close(load);
                layer.msg('连接超时，请联系后台管理员', {icon: 2, time:3000});
            });
            return false;
        });
    });
</script>
{/block}